Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jul 2015 19:23:00 +0000
From:      "Pokala, Ravi" <rpokala@panasas.com>
To:        "Sundararajan, Lakshmi" <lakshmi.n@msystechnologies.com>, "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Cc:        "panasas-network@msystechnologies.com" <panasas-network@msystechnologies.com>, "Lewis, Fred" <flewis@panasas.com>, "Tallam, Sreen" <sreen@panasas.com>
Subject:   Re: FreeBSD LAG LACP timeout tunable through IOCTL
Message-ID:  <D1D7DC6F.13E77A%rpokala@panasas.com>
In-Reply-To: <55b0decc.2a80460a.3a90.ffffa91a@mx.google.com>
References:  <55b0decc.2a80460a.3a90.ffffa91a@mx.google.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi LN,

You also need to teach `ifconfig' how to toggle this new setting. See

    sbin/ifconfig/iflagg.c:lagg_cmds[]

and how the other LACP options are handled. (Thanks to Genesys on #bsdcode
for pointing that out.)

Also, please confirm that you don't need to do any locking to walk the
list or modify any of the list elements.

Thanks,

Ravi

-----Original Message-----
From: Lakshmi Narasimhan Sundararajan <lakshmi.n@msystechnologies.com>
Date: 2015-07-23, Thursday at 05:25
To: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Cc: "panasas-network@msystechnologies.com"
<panasas-network@msystechnologies.com>, "Lewis, Fred"
<flewis@panasas.com>, Ravi Pokala <rpokala@panasas.com>, "Tallam, Sreen"
<sreen@panasas.com>
Subject: FreeBSD LAG LACP timeout tunable through IOCTL

>Hi FreeBSD team,
>In FreeBSD-10 and in Current, by default LACP supports only long timeout.
>FreeBSD does not provide the way to configure LACP timeout period.
>We made code changes for LACP Fast-timeout (Using IOCTL, both GET / SET)
>on FreeBSD-11.
>
>And we were able to successfully test the operation using IOCtl calls
>from userland.
>
>
>Initially we wanted to use sysctl, but found in FreeBSD revision history,
>that sysctl in LAG results in LOR and has to be converted to IOCTL.
>Please let us know your comments to take this forward.
>
>
>
>
>Diffs inline:
>Index: sys/net/ieee8023ad_lacp.h
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>--- sys/net/ieee8023ad_lacp.h (revision 285195)
>+++ sys/net/ieee8023ad_lacp.h (working copy)
>@@ -251,6 +251,7 @@
>   u_int32_t lsc_tx_test;
>  } lsc_debug;
>  u_int32_t  lsc_strict_mode;
>+ u_int32_t  lsc_fast_timeout; /* if set, fast / short timeout */
> };
>=20
> #define LACP_TYPE_ACTORINFO 1
>Index: sys/net/if_lagg.c
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>--- sys/net/if_lagg.c (revision 285195)
>+++ sys/net/if_lagg.c (working copy)
>@@ -1257,6 +1257,8 @@
>     ro->ro_opts |=3D LAGG_OPT_LACP_RXTEST;
>    if (lsc->lsc_strict_mode !=3D 0)
>     ro->ro_opts |=3D LAGG_OPT_LACP_STRICT;
>+   if (lsc->lsc_fast_timeout !=3D 0)
>+    ro->ro_opts |=3D LAGG_OPT_LACP_TIMEOUT;
>=20
>    ro->ro_active =3D sc->sc_active;
>   } else {
>@@ -1292,6 +1294,8 @@
>   case -LAGG_OPT_LACP_RXTEST:
>   case LAGG_OPT_LACP_STRICT:
>   case -LAGG_OPT_LACP_STRICT:
>+  case LAGG_OPT_LACP_TIMEOUT:
>+  case -LAGG_OPT_LACP_TIMEOUT:
>    valid =3D lacp =3D 1;
>    break;
>   default:
>@@ -1320,6 +1324,7 @@
>     sc->sc_opts &=3D ~ro->ro_opts;
>   } else {
>    struct lacp_softc *lsc;
>+   struct lacp_port *lp;
>=20
>    lsc =3D (struct lacp_softc *)sc->sc_psc;
>=20
>@@ -1342,6 +1347,16 @@
>    case -LAGG_OPT_LACP_STRICT:
>     lsc->lsc_strict_mode =3D 0;
>     break;
>+   case LAGG_OPT_LACP_TIMEOUT:
>+           LIST_FOREACH(lp, &lsc->lsc_ports, lp_next)
>+                          lp->lp_state |=3D LACP_STATE_TIMEOUT;
>+    lsc->lsc_fast_timeout =3D 1;
>+    break;
>+   case -LAGG_OPT_LACP_TIMEOUT:
>+           LIST_FOREACH(lp, &lsc->lsc_ports, lp_next)
>+                          lp->lp_state &=3D ~LACP_STATE_TIMEOUT;
>+    lsc->lsc_fast_timeout =3D 0;
>+    break;
>    }
>   }
>   LAGG_WUNLOCK(sc);
>Index: sys/net/if_lagg.h
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>--- sys/net/if_lagg.h (revision 285195)
>+++ sys/net/if_lagg.h (working copy)
>@@ -150,6 +150,7 @@
> #define LAGG_OPT_LACP_STRICT  0x10  /* LACP strict mode */
> #define LAGG_OPT_LACP_TXTEST  0x20  /* LACP debug: txtest */
> #define LAGG_OPT_LACP_RXTEST  0x40  /* LACP debug: rxtest */
>+#define LAGG_OPT_LACP_TIMEOUT  0x80  /* LACP Fast timeout */
>  u_int   ro_count;  /* number of ports */
>  u_int   ro_active;  /* active port count */
>  u_int   ro_flapping;  /* number of flapping */
>
>
>Thanks,
>LN
>
>
>MSYS Technologies
>
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D1D7DC6F.13E77A%rpokala>